<template>
  <div class="active">
    <div class="banner"></div>
    <!-- 面包屑导航 -->
    <breadcrumb></breadcrumb>
    <div class="actives-box">
      <ul>
        <li v-for="item in list" :key="item.active_id">
          <div class="active-left">
            <img :src="require(`@/assets/images/${item.pic}`)" alt="">
          </div>
          <div class="active-right">
            <h3>{{ item.title }}<span :class="[item.type===1?'act-type1':'act-type2']">{{ item.type===1?'活动':'演出' }}</span></h3>
            <div class="active-node">
              <p><i class="iconfont icon-weizhi"></i> 地点<span>{{ item.location }}</span></p>
              <p><i class="iconfont icon-shijian"></i> 时间<span>{{ item.time }}</span></p>
              <p><i class="iconfont icon-iconfontgerenzhongxin"></i> 票种<span class="ticket">{{ item.price }}</span></p>
              <a href="javascript:;">立即预约</a>
            </div>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: []
    }
  },
  created() {
    this.getActData()
  },
  methods: {
    getActData() {
      this.$axios
        .get('/data/active.json')
        .then((response) => {
          let { status, data } = response
          if (+status !== 200) return
          this.list = data
        })
        .catch((error) => {
          console.log(error)
        })
    }
  }
}
</script>

<style scoped>
/* 主体样式 */
.banner {
  width: 100%;
  height: 37vh;
  background: url(../assets/images/banner3.png) no-repeat;
  background-size: cover;
}
.active {
  background: #f5f5f5;
  box-shadow: 2px 2px 3px #eeeeee;
  overflow: hidden;
}
.actives-box {
  max-width: 1000px;
  margin: 0 auto;
  overflow: hidden;
}
.actives-box > ul li {
  display: flex;
  justify-content: center;
  height: 300px;
  margin: 20px 0;
}
.actives-box > ul li .active-left {
  width: 47%;
  overflow: hidden;
}
.actives-box > ul li .active-left img {
  width: 110%;
  height: 110%;
}
.actives-box > ul li .active-right {
  width: 50%;
  background: #fff;
  padding: 1.5vw 1.5vw 0;
}
.actives-box > ul li .active-right h3 {
  font-size: 16px;
  line-height: 32px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eeeeee;
}
.actives-box > ul li .active-right h3 span {
  margin-left: 10px;
  font-weight: normal;
  padding: 1px 5px;
  color: #fff;
}

.actives-box > ul li .active-right h3 .act-type1 {
  background: #03a9f4;
}
.actives-box > ul li .active-right h3 .act-type2 {
  background: chocolate;
}
.actives-box > ul li .active-right .active-node p {
  font-size: 15px;
  line-height: 35px;
}
.actives-box > ul li .active-right .active-node p span {
  color: #333;
  margin-left: 10px;
}
.actives-box > ul li .active-right .active-node p .ticket {
  padding: 1px 3px;
  border: 1px dashed #cccccc;
}
.actives-box > ul li .active-right .active-node a {
  display: block;
  width: 180px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  color: #f5f5f5;
  border-radius: 5px;
  background-color: #b92f2f;
  margin-top: 20px;
}
.actives-box > ul li .active-right .active-node a:hover {
  background-color: #c02929;
}

/* 移动端样式 */
@media screen and (max-width: 767px) {
  .banner {
    display: none;
  }
  .actives-box {
    margin-top: 0;
    padding-top: 10px;
  }
  .actives-box > ul li {
    flex-wrap: wrap;
    height: 90vw;
  }
  .actives-box > ul li .active-left {
    width: 80%;
    height: 70%;
  }
  .actives-box > ul li .active-right {
    width: 80%;
    height: 30%;
  }
  .actives-box > ul li .active-right h3 {
    font-size: 12rem;
    line-height: 5vw;
  }
  .actives-box > ul li .active-right h3 span {
    font-size: 10rem;
  }
  .actives-box > ul li .active-right .active-node {
    position: relative;
  }

  .actives-box > ul li .active-right .active-node p {
    font-size: 10rem;
    line-height: 5vw;
  }

  .actives-box > ul li .active-right .active-node a {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 25vw;
    height: 6vw;
    font-size: 10rem;
    line-height: 6vw;
    margin-top: 5px;
  }
}
</style>